package com.partybuilding.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.partybuilding.annotation.DataScope;
import com.partybuilding.domain.entity.AdminRole;
import com.partybuilding.domain.entity.Admintable;
import com.partybuilding.domain.entity.Roletable;
import com.partybuilding.mapper.RoletableMapper;
import com.partybuilding.service.RoletableService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 角色权限表(Roletable)表服务实现类
 *
 * @author makejava
 * @since 2023-11-09 16:10:36
 */
@Service("roletableService")
public class RoletableServiceImpl extends ServiceImpl<RoletableMapper, Roletable> implements RoletableService {
    public Roletable getRoleByName(String roleName){
        LambdaQueryWrapper<Roletable> lambdaQueryWrapper=new LambdaQueryWrapper();
        lambdaQueryWrapper
                .eq(Roletable::getRole_name,roleName);
        Roletable roletable= getOne(lambdaQueryWrapper);
        return roletable;
    }

    public Roletable getRoleById(String Id){
        LambdaQueryWrapper<Roletable> lambdaQueryWrapper=new LambdaQueryWrapper();
        lambdaQueryWrapper
                .eq(Roletable::getRole_id,Id);
        Roletable roletable= getOne(lambdaQueryWrapper);
        return roletable;
    }



}

